<template>
  <div id="app">
    <transition name="fade" mode="out-in">
      <div>
        <keep-alive>
          <router-view v-if="$route.meta.keepAlive" />
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive" />
      </div>
    </transition>
  </div>
</template>
<script>
import { mapActions } from "vuex";
import { Notify } from "vant";
export default {
  methods: {
    ...mapActions(["loadIP", "loadUser", "loadProductionLines"]),
  },
  created() {
    this.loadIP().catch((e) => {
      if (e === "unset") {
        Notify({ type: "warning", message: "ip地址未设置，请设置ip地址" });
      } else {
        Notify({ type: "danger", message: e });
      }
    });
    this.loadUser();
    this.loadProductionLines();
  },
};
</script>
<style lang="less">
@import "assets/less/comm";
html,
body,
div {
  padding: 0;
  margin: 0;
}
html,
body {
  height: 100%;
  font-size: 16px;
}
body {
  background-color: #f7f8fa;
}
#app {
  height: 100%;
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}
.fade-enter,
.fade-leave-active {
  opacity: 0;
}
.ag-theme-alpine .ag-row {
  font-size: 0.625rem !important;
}
</style>
